﻿@model IEnumerable<Citi.Scheduler.WebUi.Models.UserModel>

<table class="table table-bordered table-striped">
    <tr>
        <th style="width: 300px;">
            Name
        </th>
        <th>
            SoeId
        </th>
        <th>
            Manager
        </th>
        <th>
        </th>
    </tr>
    @foreach (var item in Model.OrderBy(x => x.Name))
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Soeid)
            </td>
            <td>
                @if (item.Manager != null)
                {
                    @Html.DisplayFor(modelItem => item.Manager.Name) <text>-</text> @Html.DisplayFor(modelItem => item.Manager.Soeid)
                }
            </td>
            <td>
                @Ajax.ActionLink("Edit", "ActionForm", new { id = item.Id }, new AjaxOptions { UpdateTargetId = "divUpdateUser", OnBegin = "openUpdateUserDialog" }, new { @class = "icon-pencil" })
                |
                @Ajax.ActionLink("Delete", "Delete", new { id = item.Id }, new AjaxOptions { UpdateTargetId = "divIndexUser", Confirm = "Are you sure?" }, new { @class = "icon-remove" })
            </td>
        </tr>
    }
</table>
